home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-30 | 83.7 KB | 2,243 lines |
- // ----------------------------------------------------------------------
- // Copyright ⌐ 1995, National Education Training Group, Inc. -
- // All rights reserved. -
- // -
- // Skill Builder 4.0 Course Installation by Jerry Malik -
- // -
- //-----------------------------------------------------------------------
-
- #include ".\\declare.rul"
- #include "c:\\dialog\\dll\\resource.h"
- #include ".\\winsub.h"
-
- program // Must use program keyword to start the statements
-
- //-------------------------------------------------------------------
- // This procedure initializes screen colors -
- //-------------------------------------------------------------------
-
- Start:
- szSourcedir = SRCDIR;
- VarSave( SRCTARGETDIR ); // Saves initial system variables
-
- SetColor( STATUSBAR, RED );
- SetFont( FONT_TITLE, STYLE_NORMAL, "Helv" );
- Enable( BACKGROUND );
-
- //--------------------------------------------------------------------
- // This code initializes the windows display -
- //--------------------------------------------------------------------
-
- GetProfString( szMessages, "Titles", "INIT_PARAM", szText );
- SetStatusWindow( 1, szText );
-
- // Enable/Disable various objects.
- Disable( BITMAPFADE ); // No bitmaps will fade into the screen.
- Enable( INDVFILESTATUS ); // Shows all filenames when copied.
- Enable( EXIT ); // Exit Button
- Disable( PAUSE ); // Pause Button
- Disable( STATUS ); // Status , % Complete Bar Window
- Disable( TEXT ); // Info Windows
- Disable( FEEDBACK_FULL); // Feedback window enabled
-
- // Define variable to point to the Dialog Box DLL
- szMessages = SUPPORTDIR ^ "MESSAGES.INI";
-
- ChangeDirList = ListCreate( STRINGLIST );
-
- // Set global variables for directories/files used throughout the installation
-
- szWinSys = WINDIR ^ "SYSTEM"; // points to WINDOWS\SYSTEM directory
- szWindows = WINDIR; // points to WINDOWS directory
- szWinINI = WINDIR ^ "WIN.INI"; // points to WIN.INI file
- szNETGINI = WINDIR ^ "NETG.INI"; // points to NETG.INI file
- szSourcePath = szSourcedir ^ "install.ini"; // points to INSTALL.INI file
- GetProfString( szMessages, "Titles", "PROGRAM_GROUP_TITLE", szPgrp ); // Gets Program Group title
-
- Handler( EXIT, Exit_Handler );
-
- // Gets specific course information from INSTALL.INI
-
- call GetCourseInfo;
-
-
- // Set up background depending on course version.
-
- if ( szVersion < "4.0" ) then
- szBitmapPath = szSourcedir ^ "NETGLOG8.BMP";
- SetColor( BACKGROUND, BLUE ); // Use 3.0 bitmap
- PlaceBitmap( szBitmapPath, 101, 20, 20, UPPER_RIGHT );
- szTitle = "Skill Builder « Installation";
- SetTitle( szTitle, 18, WHITE );
- else
- szBitmapPath = SUPPORTDIR ^ "NETGLOG8.BMP"; // Use 4.0 bitmap, compressed into support directory
- PlaceBitmap( szBitmapPath, 1, CENTERED, CENTERED, CENTERED );
- SetColor( BACKGROUND, RGB(255,255,255) ); // Set background color to white
- GetSystemInfo(VIDEO, nvIconIndex, svWrkDir); // Determine the resolution setting for the system
- if ((nvIconIndex = IS_UVGA) | (nvIconIndex = IS_UNKNOWN)) then // Move the status window so that it doesn't
- PlaceWindow( STATUS, 300, 70, LOWER_RIGHT); // cover "Skill Builder" on the bitmap depending
- elseif (nvIconIndex = IS_XVGA) then // on the system resolution settings
- PlaceWindow( STATUS, 250, 30, LOWER_RIGHT);
- else
- PlaceWindow( STATUS, CENTERED, CENTERED, CENTERED);
- endif;
- szTitle = szCourse + " Course Installation";
- SetTitle( szTitle, 18, BLUE );
- endif;
-
- // Checks for existence of NETG.INI and if not found, copies generic
- // file for installation.
-
- FindFile( szWindows, "NETG.INI", szText );
- if LAST_RESULT != 0
- then
- TARGETDIR = szWindows;
- CopyFile( "NETG.INI", "NETG.INI" );
- endif;
-
-
- //-------------------------------------------------------------------------
- // Checks to see if the course has been previously installed. -
- // If the course path exists notifies the user that the course has been -
- // previously installed and sets default path to the previous path, the -
- // previous path of the last course installed or C:\. -
- //-------------------------------------------------------------------------
-
- GetProfString(szNETGINI, szCourse, "path", szPath );
- szText = szPath ^ "SKILLB";
- szText = szText ^ szCourse;
- if ( ExistsDir( szText ) = EXISTS ) then
- nPresent=1;
- szResultPath = szPath;
- call CoursePresent;
- GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if ( szLMPath ="") then
- if (( nMediaType & CD_ROM ) & (szVersion > "4.0")) then
- szLMPath = "C:" ^ "SKILLB";
- else
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- endif;
- else
- nPresent=0;
- GetProfString( szNETGINI, "Course", "Total", szText );
- GetProfString( szNETGINI, "Course", "Name" + szText, szText );
- GetProfString( szNETGINI, szText, "Path", szResultPath );
- GetProfString( szNETGINI, szText, "UserPath", szLMPath );
- if ( ExistsDir (szResultPath) = EXISTS) then
- if !( ExistsDir (szLMPath) = EXISTS) then
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- else
- szResultPath = "C:";
- szLMPath = "C:\\SKILLB";
- endif;
- endif;
- StrToUpper ( szResultPath, szResultPath );
- StrToUpper ( szLMPath, szLMPath );
-
-
-
- szDialogs = SUPPORTDIR ^ "dialogs.dll"; // Load dialog dll
- UseDLL ("NEINSTL.DLL");
- nCheckSpace=0;
-
-
- // Call user registration dialog box - do not run if course is running entirely off of CD - SB ver >= 4.0
- if ((nMediaType & SINGLE_LEARNER) | (nMediaType & MULTI_LEARNER)) then
- call GetLicense;
- elseif ((nMediaType & CD_ROM) | (nMediaType & PC_CBT))then
- szDialog = "DLG_GETREGEX";
- nDialog = DLG_GETREGEX;
- call GetRegistration;
- endif;
-
- // Determine which dialog box to display
- call IdentifyDialog;
-
- GetInput:
-
- DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED );
-
- bDone = FALSE;
- while (bDone = FALSE)
-
- nCmdValue = WaitOnDialog (szDialog);
- switch ( nCmdValue )
-
- case DLG_INIT:
- nHwnd = CmdGetHwndDlg( szDialog );
-
- CtrlSetState( szDialog, IDC_MASTERY_FULL, BUTTON_CHECKED );
- //** disable the continue button
- //** _WinSubEnableControl( nHwnd, IDC_LM_PATH, DISABLE );
-
- //** nResult = _WinSubGetChildWindow(nHwnd, IDC_LM_PATH);
- //** _WinSubShowWindow(nResult, 0);
-
- CtrlSetText( szDialog, IDC_INSTALL_PATH, szResultPath ^ "SKILLB" ^ szCourse + "\\" );
- CtrlSetText( szDialog, IDC_LM_PATH, szLMPath + "\\");
- if ( nMediaType & SV_EXISTS ) then
-
- // Set default setting for SkillVantage button on.
-
- CtrlSetState( szDialog, IDC_SKILLVANTAGE, BUTTON_CHECKED );
- elseif ( nMediaType & NO_SKILLB_LMGT) | ( nMediaType & LAN ) then
- else
-
- // Set default setting for SB Learner Mgt button on.
-
- CtrlSetState( szDialog, IDC_SB_LEARNER_MGT, BUTTON_CHECKED );
- endif;
-
-
- if ( nMediaType & CD_ROM ) then
- if (nMediaType & AUTO_PAGE_FWD_OFF ) then
- CtrlSetState( szDialog, IDC_AUTO_PAGE_FORWARD, BUTTON_UNCHECKED );
- else
- CtrlSetState( szDialog, IDC_AUTO_PAGE_FORWARD, BUTTON_CHECKED );
- endif;
- endif;
- call EnoughSpace;
- GetDisk( szResultPath, szDisk );
- GetDiskSpace( szDisk );
- nSpaceAvail = LAST_RESULT;
- nSpaceAvail = nSpaceAvail / 1000000;
- NumToStr (szFile,nSpaceAvail);
- szFile = szFile + "MB";
- szDiagSpAvailText = szDiagSpAvailText + szFile;
- CtrlSetText( szDialog, IDC_SPACE_AVAILABLE, szDiagSpAvailText);
-
- NumToStr (szFile,nSpace);
- szFile = szFile + "MB";
- szDiagSpReqText = szDiagSpReqText + szFile;
- CtrlSetText( szDialog, IDC_SPACE_REQUIRED, szDiagSpReqText);
-
- case DLG_ERR:
- GetProfString( szMessages, "Messages", "DIALOG_ERR", szText1);
- MessageBox( szText, SEVERE );
- call ExitInstall;
-
- case IDOK:
-
- if ( szVersion > "3.1" ) then
- CtrlGetState (szDialog, IDC_SKILLVANTAGE );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- nInstallOptions = SV_MANAGER_SELECT;
- else
- CtrlGetState (szDialog, IDC_SB_LEARNER_MGT );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- nInstallOptions = SB_LMGT_SELECT;
- CtrlGetText (szDialog, IDC_LM_PATH, szLMPath );
- nOffset = StrLength(szLMPath);
- StrSub(szLMPath, szLMPath, 0, nOffset - 1 );
- StrToUpper (szLMPath, szLMPath);
-
- else
- nInstallOptions = NO_MGT_SELECT;
- endif;
- endif;
- CtrlGetState (szDialog, IDC_TIME_OUT );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- szTimeOut = "50";
- nInstallOptions = nInstallOptions | TIME_OUT;
- elseif ( LAST_RESULT = BUTTON_UNCHECKED ) then
- szTimeOut = "0";
- else
- endif;
- CtrlGetState (szDialog, IDC_AUTO_PAGE_FORWARD );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- szAutoPage = "1";
- elseif ( LAST_RESULT = BUTTON_UNCHECKED ) then
- szAutoPage = "0";
- endif;
- CtrlGetState (szDialog, IDC_MASTERY_FULL );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- nInstallOptions = nInstallOptions | MASTERY_FULL_SELECT;
- endif;
- CtrlGetState (szDialog, IDC_MASTERY_PARTIAL );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- nInstallOptions = nInstallOptions | MASTERY_PARTIAL_SELECT;
- endif;
- CtrlGetState (szDialog, IDC_MASTERY_NONE );
- if ( LAST_RESULT = BUTTON_CHECKED ) then
- nInstallOptions = nInstallOptions | MASTERY_NONE_SELECT;
- endif;
- endif;
- szText = "";
- bDone = TRUE;
- //***
- if (( nMediaType & CD_ROM ) & (szVersion > "4.0")) then // Course is running off of CD
- ParsePath(szResultPath, szSourcedir, DISK);
- call VerifyLMPath;
- else
-
- bDone2 = TRUE;
- call VerifyTarget;
- if ( bDone ) then
- call CheckIfExists;
- endif;
- if ( bDone ) then
- call EnoughSpace;
- endif;
- if ( bDone) then
- if ( nInstallOptions & SB_LMGT_SELECT ) then
- call VerifyLMPath;
- endif;
- endif;
- endif;
-
- case IDHELP:
- call Help_Handler;
-
- case CHANGE_COURSE_PATH:
- szChangeDir = szResultPath;
- szCoursePath = "SKILLB\\" + szCourse + "\\";
- call ChangeDir;
- if (StrCompare (szText, "NO") != 0) then
- szResultPath = szNewPath;
- endif;
- CtrlSetText( szDialog, IDC_INSTALL_PATH, szResultPath ^ "SKILLB" ^ szCourse + "\\");
- // call CheckIfExists;
- call EnoughSpace;
- GetDiskSpace( szDisk );
- nSpaceAvail = LAST_RESULT;
- nSpaceAvail = nSpaceAvail / 1000000;
- NumToStr (szFile,nSpaceAvail);
- szFile = szFile + "MB";
- szDiagSpAvailText = szDiagSpAvailText + szFile;
- CtrlSetText( szDialog, IDC_SPACE_AVAILABLE, szDiagSpAvailText);
-
- NumToStr (szFile,nSpace);
- szFile = szFile + "MB";
- szDiagSpReqText = szDiagSpReqText + szFile;
- CtrlSetText( szDialog, IDC_SPACE_REQUIRED, szDiagSpReqText);
-
- case COURSE_CHANGE_LMPATH:
- szChangeDir = szLMPath;
- szCoursePath = "";
- call ChangeDir;
- if (StrCompare (szText, "NO") != 0) then
- szLMPath = szNewPath;
- endif;
- CtrlSetText( szDialog, IDC_LM_PATH, szLMPath + "\\" );
-
- case IDCANCEL:
- call ConfirmCancel;
-
- case DLG_CLOSE:
- call ConfirmCancel;
-
- endswitch;
- endwhile;
- EndDialog (szDialog);
- ReleaseDialog (szDialog);
-
- //***
-
-
- //***
- // Checks for animation driver and loads it if it doesn't exist.
-
- GetSystemInfo ( CPU, nResult, szText );
- if ( nResult = IS_386 ) then
- goto LoadCourse;
- endif;
-
- if (( nMediaType & CD_ROM ) | ( nMediaType & PC_CBT )) then
- if !( nMediaType & NO_MOVIE ) then
- if ( szVersion > "4.0" ) then
- goto LoadCourse;
- else;
- call CheckAnimationDriver;
- endif;
- endif;
- endif;
-
- // ----------------------------------------------------------------------
- // Creates course directory and loads files.
- // ----------------------------------------------------------------------
-
- LoadCourse:
-
- // Checks to make sure that the course directory can be created.
-
- szCoursePath = szResultPath ^ "SKILLB";
- szCoursePath = szCoursePath ^ szCourse;
- if ( CreateDir ( szCoursePath ) != 0 ) then
- GetProfString( szMessages, "Messages", "CREATE_DIR_ERR", szText);
- MessageBox( szText, WARNING );
- goto GetInput;
- endif;
-
- //****
- if ( nMediaType & LAN) then
- if ( szVersion > "4.0" ) then
- // GetDisk( szSourcedir, szDisk );
- // SRCDIR = szDisk ^ "\\";
- SRCDIR = szSourcedir;
- TARGETDIR = szResultPath ^ "SKILLB";
- szSBDbase = "ASBMSG40.DBF";
- if (FileCompare( "szSBDbase",
- "szSBDbase",
- COMPARE_DATE ) != LESS_THAN) then
- if (FileCompare( "szSBDbase",
- "szSBDbase",
- COMPARE_DATE ) != EQUALS) then
- if (CopyFile( szSBDbase, szSBDbase ) < 0) then
- GetProfString( szMessages, "Messages", "ICONWARE_DB_UPDATE_ERROR", szText );
- MessageBox ( szText , WARNING );
- endif;
- endif;
- endif;
- endif;
- endif;
-
-
- //*****
- // If network install, creates a directory to hold the Workstation install files.
-
- GetDisk( szCoursePath, szDisk );
- GetSystemInfo ( DRIVE, nResult, szDisk );
- if ( nResult = IS_REMOTE ) then
- if ( nMediaType & LAN ) then
- if ( CreateDir ( szResultPath ^ "SKILLB\\WS" ) != 0 ) then
- GetProfString( szMessages, "Messages", "CREATE_DIR_ERR", szText);
- MessageBox( szText, WARNING );
- goto GetInput;
- endif;
- endif;
- endif;
-
- GetDisk(szSourcedir, szDisk);
- SRCDIR = szDisk ^ "\\";
-
- // Decompressing/Copying files to target directory
- // Show the % Complete Status Bar
-
- GetProfString( szMessages, "Titles", "INS_MISC_FILES", szText );
- SetStatusWindow( 1, szText );
- StatusUpdate( 1, 8 );
-
- if ( nMediaType & LAN ) then // Update Workstation Install files
-
- TARGETDIR = szResultPath ^ "SKILLB\\WS";
- if ( CompressGet( "WS.Z", "", COMP_UPDATE_DATE_NEWER ) <0) then
- szText = "WS.Z";
- call CopyError;
- endif;
- endif;
-
- TARGETDIR = szResultPath ^ "SKILLB"; // Define target directory for decompressing files
-
- // Checks for type of install - floppy or CD and call appropriate subroutine.
-
- GetSystemInfo ( DRIVE, nResult, szDisk );
- if ( nResult = IS_REMOVABLE )
- then
- call LoadDisk;
- else
- call LoadCD;
- endif;
-
- Disable ( FEEDBACK_FULL );
- Disable ( STATUS );
-
- call UpdateNETGINI;
- call Complete;
-
- // Displays correct complete install message
-
- // Special message for installing SkillVantage tutorial
- if (szVersion = "3.2x") then
- if ( nInstallOptions & SV_MANAGER_SELECT ) then
- call CheckSkillVantage;
- endif;
- MessageBox( SKILLV_EXIT, INFORMATION );
- call ExitInstall;
- endif;
-
- if ( nInstallOptions & SV_MANAGER_SELECT ) then // Installation with SkillVantage Manager selected
- call CheckSkillVantage;
- GetProfString( szMessages, "Messages", "COMPLETE-2A", szText);
- GetProfString( szMessages, "Messages", "COMPLETE-2B", szText1);
- szText = szText + "\n\n" + szText1;
- GetProfString( szMessages, "Messages", "COMPLETE-2C", szText1);
- szText = szText + "\n" + szText1;
- GetProfString( szMessages, "Messages", "COMPLETE-2D", szText1);
- szText = szText + "\n\n" + szText1;
- MessageBox( szText, INFORMATION );
-
- else // Installation without SkillVantage Manager selected
- GetProfString( szMessages, "Messages", "COMPLETE-A", szText);
- GetProfString( szMessages, "Messages", "COMPLETE-B", szText1);
- szText = szText + "\n\n" + szText1;
- GetProfString( szMessages, "Messages", "COMPLETE-C", szText1);
- szText = szText + "\n" + szText1;
- GetProfString( szMessages, "Messages", "COMPLETE-D", szText1);
- szText = szText + "\n" + szText1;
- GetProfString( szMessages, "Messages", "COMPLETE-E", szText1);
- szText = szText + "\n\n" + szText1;
- MessageBox( szText, INFORMATION );
- endif;
-
-
- call ExitInstall; // Clears list variables and exits from installation
-
-
- //-----------------------------------------------------------------------------------------------
- // The following code reads the install.ini file to get the course number, name, and icon tag. -
- //-----------------------------------------------------------------------------------------------
-
- GetCourseInfo:
-
-
- GetProfString( szSourcePath, "course", "number", szCourse );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "course", "name", szCourseName );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "course", "courseid", szCourseID );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "course", "icon", szIconTag );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "course", "iconfile", szIconFile );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "install", "network", szNetwork );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "install", "type", szText2 );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- StrToUpper( szText2, szText2 );
- if ( szText2 = "CD" ) then
- nMediaType = CD_ROM;
- elseif
- ( szText2 = "PC/CBT" ) then
- nMediaType = PC_CBT;
- elseif
- ( szText2 = "LAN" ) then
- nMediaType = LAN;
- else
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "install", "lang", szLang );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- GetProfString( szSourcePath, "install", "ver", szVersion );
- if LAST_RESULT != 0
- then
- goto BadInstallINI;
- endif;
-
- // Optional line in INSTALL.INI which turns Student Management off for the course.
-
- GetProfString( szSourcePath, "install", "StudentMgt", szStMgt );
- StrToUpper( szStMgt, szStMgt );
- if ( szStMgt = "NO" ) then
- nMediaType = nMediaType | NO_SKILLB_LMGT;
- endif;
-
- // Optional line in INSTALL.INI which indicates that there is no movie for the course.
-
- GetProfString( szSourcePath, "install", "Movie", szText );
- StrToUpper( szText, szText );
- if ( szText = "NO" ) then
- nMediaType = nMediaType | NO_MOVIE;
- endif;
-
- // Optional line in INSTALL.INI which indicates that auto page advance defaults to off
-
- GetProfString( szSourcePath, "install", "AutoPageForward", szText );
- StrToUpper( szText, szText );
- if ( szText = "OFF" ) then
- nMediaType = nMediaType | AUTO_PAGE_FWD_OFF;
- endif;
-
- // Optional line in INSTALL.INI which indicates that this is a Single Learner product
-
- GetProfString( szSourcePath, "install", "SingleLearner", szText );
- StrToUpper( szText, szText );
- if ( szText = "YES" ) then
- nMediaType = nMediaType | SINGLE_LEARNER;
- endif;
-
- // Optional line in INSTALL.INI which indicates that this is a Multi-Learner product
-
- GetProfString( szSourcePath, "install", "MultiLearner", szText );
- StrToUpper( szText, szText );
- if ( szText = "YES" ) then
- nMediaType = nMediaType | MULTI_LEARNER;
- endif;
-
- // Checking to see if SkillVantage Manager is installed.
-
- FindFile( szWindows, "SKILLV.INI", szText );
- if ( szText = "SKILLV.INI" ) then
- nMediaType = nMediaType | SV_EXISTS;
- endif;
- return;
-
- //-----------------------------------------------------------------------
- // Displays dialog box and verification screen for user information.
- //-----------------------------------------------------------------------
- GetLicense:
-
- GetProfInt(szSourcePath, "Agreements", "Total", nTotalAgreements );
- AgreementList = ListCreate( STRINGLIST );
-
- for nCount = 1 to nTotalAgreements
- NumToStr(szText,nCount);
- GetProfString(szSourcePath, "Agreements", "Name" + szText, szAgreement );
- ListAddString ( AgreementList, szAgreement, AFTER );
- endfor;
-
- szDialog = "LICENSE_AGREEMENT_INIT";
- nDialog = LICENSE_AGREEMENT_INIT;
- if (DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED ))
- then
- GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
- MessageBox( szText, SEVERE );
- call ExitInstall;
- endif;
- bDone = FALSE;
- while (bDone = FALSE)
-
- nCmdValue = WaitOnDialog (szDialog);
- switch ( nCmdValue )
-
- case DLG_INIT:
- CtrlSetList ( szDialog, LICENSE_AGREEMENT_LIST, AgreementList );
- CtrlSetCurSel ( szDialog, LICENSE_AGREEMENT_LIST, szAgreement );
- CtrlSelectText (szDialog, LICENSE_AGREEMENT_LIST );
-
-
- case DLG_ERR:
- GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
- MessageBox( szText, SEVERE );
- call ExitInstall;
-
- case IDOK:
- szText = "";
- CtrlGetCurSel ( szDialog, LICENSE_AGREEMENT_LIST, szAgreement );
- GetProfString(szSourcePath, szAgreement, "file", szAgreement );
- VarRestore( SRCTARGETDIR );
- bDone = TRUE;
-
- case IDCANCEL:
- call ConfirmCancel;
-
- case DLG_CLOSE:
- call ConfirmCancel;
-
- endswitch;
- endwhile;
-
- EndDialog( "LICENSE_AGREEMENT_INIT" );
- ReleaseDialog( "LICENSE_AGREEMENT_INIT" );
-
- szDialog = "LICENSE_ACCEPT";
- nDialog = LICENSE_ACCEPT;
-
- GetRegistration:
-
- if (DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED ))
- then
- GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
- MessageBox( szText, SEVERE );
- call
- ExitInstall;
- endif;
- bDone = FALSE;
- while (bDone = FALSE)
-
- nCmdValue = WaitOnDialog (szDialog);
- switch ( nCmdValue )
- case DLG_INIT:
- CtrlSetText( szDialog, ID_DLG_GETREGEX_NAME, szName );
- CtrlSetText( szDialog, ID_DLG_GETREGEX_CO, szCompany );
-
- CtrlSelectText( szDialog, ID_DLG_GETREGEX_NAME );
- nHwnd = CmdGetHwndDlg( szDialog );
-
- // disable the continue button
- _WinSubEnableControl( nHwnd, IDOK, DISABLE );
-
- // check if all the fields are not empty if they are
- // not then enable the continue button
-
- if ( szName != "" ) then
- if ( szCompany != "" ) then
- _WinSubEnableControl( nHwnd, IDOK, ENABLE );
- endif;
- endif;
- //--------------------------------------------------------------------------------------------------
- // Display the license agreement for single and multi-learner products
- //--------------------------------------------------------------------------------------------------
-
- if ((nMediaType & SINGLE_LEARNER) | (nMediaType & MULTI_LEARNER)) then
- nHwdInstall = GetWindowHandle(HWND_INSTALL);
- WinHelp( nHwdInstall, szSourcedir ^ "lic.hlp", HELP_CONTENTS, 0 );
- hWnd = FindWindow( "MS_WINHELP", "");
- ShowWindow ( hWnd, SW_SHOW );
- endif;
-
-
- case ID_DLG_GETREGEX_NAME:
- nResult = CtrlGetSubCommand( szDialog );
-
- // if name field is NULL then disable the continue
- // button else enable the continue button
-
- if ( nResult = EDITBOX_CHANGE ) then
- CtrlGetText( szDialog, ID_DLG_GETREGEX_NAME, szName );
- if ( szName = "" ) then
- _WinSubEnableControl( nHwnd, IDOK, DISABLE );
- else
- if (szCompany != "" ) then
- _WinSubEnableControl( nHwnd, IDOK, ENABLE );
- endif;
- endif;
- endif;
-
- case ID_DLG_GETREGEX_CO:
- nResult = CtrlGetSubCommand( szDialog );
-
- if ( nResult = EDITBOX_CHANGE ) then
- CtrlGetText( szDialog, ID_DLG_GETREGEX_CO, szCompany );
- if ( szCompany = "" ) then
- _WinSubEnableControl( nHwnd, IDOK, DISABLE );
- else
- if (szName != "" ) then
- _WinSubEnableControl( nHwnd, IDOK, ENABLE );
- endif;
- endif;
- endif;
-
- case GET_LICENCE:
- szText = "GetLicense";
- bDone = TRUE;
-
- case DLG_ERR:
- GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
- MessageBox( szText, SEVERE );
- call ExitInstall;
-
- case IDOK:
- szText = "";
- CtrlGetText( szDialog, ID_DLG_GETREGEX_NAME, szName );
- CtrlGetText( szDialog, ID_DLG_GETREGEX_CO, szCompany );
- bDone = TRUE;
-
- case IDCANCEL:
- call ConfirmCancel;
-
- case DLG_CLOSE:
- call ConfirmCancel;
-
- endswitch;
- endwhile;
-
- EndDialog( szDialog );
- ReleaseDialog( szDialog );
-
- if ( szText = "GetLicense" ) then
- goto GetLicense;
- endif;
-
- ConfirmRegistration:
-
- szDialog = "DLG_CONFIRMEX";
- nDialog = DLG_CONFIRMEX;
- if (DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED ))
- then
- GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
- MessageBox( szText, SEVERE );
- call ExitInstall;
- endif;
- bDone = FALSE;
- while (bDone = FALSE)
-
- nCmdValue = WaitOnDialog (szDialog);
- switch ( nCmdValue )
- case DLG_INIT:
- CtrlSetText ( szDialog, ID_DLG_CONFIRMEX_NAME, szName );
- CtrlSetText ( szDialog, ID_DLG_CONFIRMEX_CO, szCompany );
-
- case IDOK:
- szText = "YES";
- bDone = TRUE;
-
- case IDCANCEL:
- szText = "NO";
- bDone = TRUE;
-
- case DLG_CLOSE:
- call ConfirmCancel;
-
- endswitch;
- endwhile;
-
- EndDialog( szDialog );
- ReleaseDialog( szDialog );
-
- if ( szText = "NO" ) then
- if ((nMediaType & SINGLE_LEARNER) | (nMediaType & MULTI_LEARNER)) then
- szDialog = "LICENSE_ACCEPT";
- nDialog = LICENSE_ACCEPT;
- else
- szDialog = "DLG_GETREGEX";
- nDialog = DLG_GETREGEX;
- endif;
- goto GetRegistration;
- endif;
- return;
-
-
- IdentifyDialog:
- //------------------------------------------------------------------------
- // Identifies the correct dialog box to display - following is a list
- // of valid dialog boxes:
- // Single
- // Media SVINI SMgt Avail Learner Dialog Box Name
- // CD Yes Yes No INSTALL_CD_SV
- // CD No Yes No INSTALL_CD
- // CD Yes Yes Yes INSTALL_CD_SV_SL
- // CD No Yes Yes INSTALL_CD_SL
- // CD Yes No No INSTALL_CD_SV_N
- // CD No No No INSTALL_CD_N
- // CBT Yes Yes -- INSTALL_CBT_SV
- // CBT No Yes -- INSTALL_CBT
- // CBT Yes No -- INSTALL_CBT_SV_N
- // CBT No No -- INSTALL_CBT_N
- // LAN Yes -- -- INSTALL_CBT_SV_N
- // LAN No -- -- INSTALL_CBT_N
- //------------------------------------------------------------------------
-
- // Start with CD-ROM courses
-
- if ( nMediaType & CD_ROM ) then
-
- // The AutoPageForward option was added in version 3.11 and later - verifies that
- // the course version is 3.11 or later and displays correct dialog box or displays
- // equivalent dialog box without AutoPageForward (PC/CBT dialog box).
-
- if (( szVersion > "3.2" ) | !(StrCompare( szVersion, "3.11" ))) then
- if ( nMediaType & SV_EXISTS ) then
- if ( nMediaType & NO_SKILLB_LMGT ) then
- szDialog = "INSTALL_CD_SV_N";
- nDialog = INSTALL_CD_SV_N;
- elseif ( nMediaType & SINGLE_LEARNER ) then
- szDialog = "INSTALL_CD_SV_SL";
- nDialog = INSTALL_CD_SV_SL;
- else
- szDialog = "INSTALL_CD_SV";
- nDialog = INSTALL_CD_SV;
- endif;
- elseif ( nMediaType & NO_SKILLB_LMGT ) then
- szDialog = "INSTALL_CD_N";
- nDialog = INSTALL_CD_N;
- elseif ( nMediaType & SINGLE_LEARNER ) then
- szDialog = "INSTALL_CD_SL";
- nDialog = INSTALL_CD_SL;
- else
- szDialog = "INSTALL_CD";
- nDialog = INSTALL_CD;
- endif;
- else
- if ( nMediaType & SV_EXISTS ) then
- if ( nMediaType & NO_SKILLB_LMGT ) then
- szDialog = "INSTALL_CBT_SV_N";
- nDialog = INSTALL_CBT_SV_N;
- else
- szDialog = "INSTALL_CBT_SV";
- nDialog = INSTALL_CBT_SV;
- endif;
- elseif ( nMediaType & NO_SKILLB_LMGT ) then
- szDialog = "INSTALL_CBT_N";
- nDialog = INSTALL_CBT_N;
- else
- szDialog = "INSTALL_CBT";
- nDialog = INSTALL_CBT;
- endif;
- endif;
- endif;
-
- if ( nMediaType & PC_CBT ) then
- if ( nMediaType & SV_EXISTS ) then
- if ( nMediaType & NO_SKILLB_LMGT ) then
- szDialog = "INSTALL_CBT_SV_N";
- nDialog = INSTALL_CBT_SV_N;
- else
- szDialog = "INSTALL_CBT_SV";
- nDialog = INSTALL_CBT_SV;
- endif;
- elseif ( nMediaType & NO_SKILLB_LMGT ) then
- szDialog = "INSTALL_CBT_N";
- nDialog = INSTALL_CBT_N;
- else
- szDialog = "INSTALL_CBT";
- nDialog = INSTALL_CBT;
- endif;
- endif;
-
- if ( nMediaType & LAN ) then
- if ( nMediaType & SV_EXISTS ) then
- szDialog = "INSTALL_CBT_SV_N";
- nDialog = INSTALL_CBT_SV_N;
- else
- szDialog = "INSTALL_CBT_N";
- nDialog = INSTALL_CBT_N;
- endif;
- endif;
-
- // Added code to find dialog boxes for 4.0 products with mastery test
-
- if ( szVersion > "4.0" ) then
- if ( nMediaType & SV_EXISTS ) then
- if ( nMediaType & SINGLE_LEARNER ) then
- szDialog = "INSTALL_CD_40_SV_SL";
- nDialog = INSTALL_CD_40_SV_SL;
- else
- szDialog = "INSTALL_CD_SV_40";
- nDialog = INSTALL_CD_SV_40;
- endif;
- else
- if ( nMediaType & SINGLE_LEARNER ) then
- szDialog = "INSTALL_CD_40_SL";
- nDialog = INSTALL_CD_40_SL;
- else
- szDialog = "INSTALL_CD_40";
- nDialog = INSTALL_CD_40;
- endif;
- endif;
-
- if ( nMediaType & LAN ) then
- if ( nMediaType & SV_EXISTS ) then
- szDialog = "INSTALL_SV_40";
- nDialog = INSTALL_SV_40;
- else
- szDialog = "INSTALL_CBT_N_40";
- nDialog = INSTALL_CBT_N_40;
- endif;
- endif;
- endif;
-
- return;
-
-
- //-----------------------------------------------------------------------
- // Verifies target is valid, if course has already been -
- // installed in the target directory and if the target -
- // directory contains Learner Management Files -
- //-----------------------------------------------------------------------
-
- VerifyTarget:
-
- if (bDone) then // Subroutine called after exiting GetInput dialog box
- szNewPath = szResultPath; // need to assign verified path to szNewPath
- endif;
-
- StrSub(szWork, szNewPath,1,1);
- if (szWork != ":") then
- GetProfString( szMessages, "Messages", "INVALID_PATH", szText);
- MessageBox (szText, WARNING);
- bDone2 = FALSE;
- bDone = FALSE;
- return;
- endif;
-
- StrLength(szNewPath);
- nOffset = LAST_RESULT - 1;
- if (nOffset < 0) then
- GetProfString( szMessages, "Messages", "INVALID_PATH", szText);
- MessageBox (szText, WARNING);
- bDone2 = FALSE;
- bDone = FALSE;
- return;
- endif;
-
- StrSub(szWork, szNewPath, nOffset, 1);
-
- StrCompare( szWork, "\\" );
- if LAST_RESULT = 0 // Trim the last backslash off
- then
- StrSub(szNewPath, szNewPath, 0, nOffset);
- endif;
-
- // if invalid disk entered, reprompt
- GetDisk( szNewPath, szDisk );
- if (ExistsDisk( szDisk ) != EXISTS ) then
- GetProfString( szMessages, "Messages", "INVALID_DRIVE", szText1);
- szText = szDisk + szText1;
- MessageBox( szText, WARNING );
- bDone2 = FALSE;
- bDone = FALSE;
- return;
- endif;
-
- // GetDisk( SRCDIR, szText );
- // if !(StrCompare (szDisk, szText)) then
- // MessageBox (SAME_DRIVE, INFORMATION);
- // bDone2 = FALSE;
- // return;
- // endif;
-
- if (bDone) then
- szResultPath = szNewPath;
- endif;
-
- return;
-
- CheckIfExists:
-
- // Don't allow an installation of a CDROM course over a network or diskette installation
-
- if ( ExistsDir( szResultPath ^ "SKILLB" ^ szCourse ) = EXISTS ) then
- if (( ExistsDir( szResultPath ^ "SKILLB" ^ szCourse ^ "PICS_ENU" ) = EXISTS ) & ( nMediaType & CD_ROM )) then
- GetProfString( szMessages, "Messages", "OTHER_MEDIA_1", szText);
- GetProfString( szMessages, "Messages", "DIFFERENT_PATH", szText1);
- MessageBox (szText + "\n\n" + szText1, INFORMATION);
- bDone = FALSE;
- return;
- endif;
- Enable( STATUS );
- GetProfString( szMessages, "Titles", "REMOVE_COURSE", szText );
- SetStatusWindow(7, szText );
- szText = szResultPath ^ "SKILLB" ^ szCourse;
-
- if ( StrCompare( szText, szLMPath ) = 0) then // Do not delete directory with Learner Management files
- nCheckSpace = 0; // since files are not deleted do not check disk space
-
- elseif (DeleteDir (szText, ALLCONTENTS ) < 0) then // Could not delete existing course directory
- GetProfString( szMessages, "Messages", "DELETE_DIR_ERR", szText1);
- MessageBox (szText1 + szText, SEVERE);
- goto ExitInstall;
-
- else
- nCheckSpace = 1; // Successfully deleted existing course directory
- endif;
- else // Course doesn't exist at szResultPath
- nCheckSpace = 1; // A setting of 1 indicates to check disk space
- endif;
- bDone = TRUE;
- Disable( STATUS );
- return;
-
- EnoughSpace:
-
- // Checks to make sure that there is enough space on the hard drive to install the course.
-
-
- //--------------------------------------------------------------------
- // This procedure calculates disk space for the course -
- // and verifies that the destination drive has -
- // sufficient space to load the course. -
- //--------------------------------------------------------------------
-
- GetDisk( szResultPath, szDisk );
- GetDiskSpace( szDisk );
- nSpaceAvail = LAST_RESULT;
- nSpaceAvail = nSpaceAvail / 1000000;
- StrSub(szText2, szResultPath, 0, 1);
- nClusterSize = GetClusterSize( szText2 );
- if ((nClusterSize < 2) | (nClusterSize > 64)) then // Out of bounds value defaults to 8k
- nClusterSize = 8;
- endif;
-
- NumToStr (szClusterSize, nClusterSize );
-
- GetSystemInfo ( DRIVE, nResult, szDisk );
- if ( nResult = IS_REMOTE ) then
- GetProfString( szMessages, "Dialogs", "IDC_SPACE_REQ_TITLE_LAN", szDiagSpReqText);
- szClusterSize = "8";
- else
- GetProfString( szMessages, "Dialogs", "IDC_SPACE_REQ_TITLE", szDiagSpReqText);
- endif;
-
- szDiagSpReqText = szDiagSpReqText + szDisk;
- szDiagSpReqText = szDiagSpReqText + " ";
-
- GetProfString( szMessages, "Dialogs", "IDC_SPACE_AVAIL_TITLE", szDiagSpAvailText);
- szDiagSpAvailText = szDiagSpAvailText + szDisk;
- szDiagSpAvailText = szDiagSpAvailText + " ";
-
- if ( GetProfInt( szSourcePath, "space", szClusterSize + "k", nSpace ) != 0 ) then
- goto BadInstallINI;
- endif;
-
-
- //----------------------------------------------------------------------------------------
- // Adjusts disk space amount if the movie doesn't exist and is provided with the course -
- //----------------------------------------------------------------------------------------
-
- if (( nMediaType & CD_ROM ) | ( nMediaType & PC_CBT )) then
- if !( nMediaType & NO_MOVIE ) then
- if ( szVersion > "4.0" ) then
- if (FindFile ( szResultPath ^ "SKILLB", "SBMOVIE3.FLI", szText ) != 0 ) then
- nSpace = nSpace + 2;
- endif;
- elseif ( szVersion > "3.2" ) then
- if (FindFile ( szResultPath ^ "SKILLB", "SBMOVIE2.FLI", szText ) != 0 ) then
- nSpace = nSpace + 3;
- endif;
- else
- if (FindFile ( szResultPath ^ "SKILLB", "SBMOVIE1.FLI", szText ) != 0 ) then
- nSpace = nSpace + 3;
- endif;
- endif;
- endif;
- endif;
-
-
- // If the course is already installed, checks to see if the current
- // installation path is the same as the previous path. If the paths
- // are the same, the disk space check is not made.
-
- if ( nCheckSpace = 0 ) then
- return;
- endif;
-
- // bDone is set to TRUE after clicking on OK from GetInput dialog box.
-
- if (( nSpace > nSpaceAvail ) & (bDone = TRUE)) then
- GetProfString( szMessages, "Titles", "SPACE_TITLE", szText );
- SetDialogTitle ( DLG_MSG_WARNING, szText );
- StrToUpper( szDisk, szDisk );
- szText = SPACE_1;
- szText = szText + szDisk;
- szText = szText + SPACE_2;
- MessageBox (szText, WARNING);
- GetProfString( szMessages, "Titles", "WARNING", szText );
- SetDialogTitle ( DLG_MSG_WARNING, szText );
- bDone = FALSE;
- return;
- endif;
- return;
-
-
- // Checks to make sure that the appropriate animation driver is loaded
- // on the system to run the movie and installs it if it doesn't exist.
-
- CheckAnimationDriver:
-
- SRCDIR = szSourcedir;
- GetFileInfo( szSourcedir ^ "MCIAAP.DRV", FILE_DATE, nResult, szText1);
- TARGETDIR = szWinSys;
- if ( FindFile ( TARGETDIR, "mciaap.drv", szText ) != 0 ) then
- if ( CopyFile ("mciaap.drv", "mciaap.drv" ) < 0 ) then
- szText2 = "MCIAAP.DRV";
- goto AbortAnimationUpdate;
- endif;
- else
- if (GetFileInfo( TARGETDIR ^ "MCIAAP.DRV", FILE_DATE, nResult, szText) = 0 ) then
- if ( szText1 > szText ) then
- SRCDIR = WINDIR ^ "SYSTEM"; // Change target directory for copying to Windows directory.
- DeleteFile( "MCIAAP.SB" );
- if ( CopyFile ( "MCIAAP.DRV", "MCIAAP.SB" ) < 0 ) then
- szText2 = "MCIAAP.DRV";
- goto AbortAnimationUpdate;
- endif;
- DeleteFile( "MCIAAP.DRV" );
- SRCDIR = szSourcedir;
- if ( CopyFile ( "MCIAAP.DRV", "MCIAAP.DRV" ) < 0) then
- szText2 = "MCIAAP.DRV";
- goto AbortAnimationUpdate;
- endif;
- endif;
- endif;
- endif;
-
-
- TARGETDIR = szWindows; // Change target directory for copying to Windows directory.
- SRCDIR = szWindows; // Change target directory for copying to Windows directory.
- GetSystemInfo ( DATE, nDisk, szDate ); // Get current date to add to update comments.
- szChangeDir = "' " + szDate + " by Skill Builder."; // Line used to add comment to updated files.
-
- CheckSystemIni:
-
- // Verify that SYSTEM.INI is correct.
-
- GetProfString( szWindows ^ "SYSTEM.INI", "MCI", "Animation", szFile );
- if ( szFile = "mciaap.drv" ) then
- goto CheckWinIni;
- endif;
-
- // If incorrect, back up file for user.
-
- if (CopyFile ( "SYSTEM.INI", "SYSTEM.SB" ) != 0) then
- szText2 = "SYSTEM.INI";
- goto AbortAnimationUpdate;
- endif;
-
- if ( szFile != "" ) then
- WriteProfString( szWindows ^ "SYSTEM.INI", "MCI", "Animation", "" );
- WriteProfString( szWindows ^ "SYSTEM.INI", "MCI", ";Changed from 'Animation", szFile + szChangeDir);
- endif;
- if ( WriteProfString( szWindows ^ "SYSTEM.INI", "MCI", "Animation", "mciaap.drv" ) < 0 ) then
- szText = "SYSTEM";
- szText2 = "SYSTEM.INI.";
- goto AbortAnimationUpdate;
- endif;
- nInstallOptions = nInstallOptions | UPDATED_SYSTEM_INI;
-
- CheckWinIni:
-
- // Verify that WIN.INI is correct.
-
- GetProfString( szWinINI, "mci extensions", "fli", szFile );
- if ( szFile = "Animation" ) then
- goto CompleteAnimationUpdate;
- endif;
-
- // If incorrect, back up file for user.
-
- if (CopyFile ( "WIN.INI", "WIN.SB" ) != 0) then
- szText2 = "WIN.INI.";
- goto AbortAnimationUpdate;
- endif;
-
- if ( szFile != "" ) then
- WriteProfString( szWinINI, "mci extensions", "fli", "" );
- WriteProfString( szWinINI, "mci extensions", ";Changed from 'fli", szFile + szChangeDir );
- endif;
- if ( WriteProfString( szWinINI, "mci extensions", "fli", "Animation" ) < 0 ) then
- szText = "WIN";
- szText2 = "WIN.INI.";
- goto AbortAnimationUpdate;
- endif;
- nInstallOptions = nInstallOptions | UPDATED_WIN_INI;
-
- CompleteAnimationUpdate:
-
- szText = "";
- szFile = "";
- if ( nInstallOptions & UPDATED_SYSTEM_INI ) then
- szText = "SYSTEM.INI";
- szFile = "SYSTEM.SB";
- endif;
- if ( nInstallOptions & UPDATED_WIN_INI ) then
- if ( szText = "" ) then
- szText = "WIN.INI";
- szFile = "WIN.SB";
- else
- szText = szText + ", WIN.INI";
- szFile = szFile + ", WIN.SB";
- endif;
- endif;
- if ( szText != "" ) then
- GetProfString( szMessages, "Messages", "ANIMATION_1", szUpdate);
- GetProfString( szMessages, "Messages", "ANIMATION_2", szText1);
- szUpdate = szUpdate + szText + "\n\n";
- szUpdate= szUpdate + szText1 + szFile;
- GetProfString( szMessages, "Messages", "ANIMATION_3", szText1);
- MessageBox( szUpdate + "\n\n" + szText1, INFORMATION );
- endif;
- return;
-
- AbortAnimationUpdate:
-
- if ( szText != "" ) then
- DeleteFile ( szText + ".SB" );
- endif;
- if ( nInstallOptions = nInstallOptions | UPDATED_SYSTEM_INI ) then
- CopyFile ( "SYSTEM.SB", "SYSTEM.INI" );
- DeleteFile ( "SYSTEM.SB" );
- endif;
- if ( nInstallOptions = nInstallOptions | UPDATED_WIN_INI ) then
- CopyFile ( "WIN.SB", "WIN.INI" );
- DeleteFile ( "WIN.SB" );
- endif;
-
- GetProfString( szMessages, "Messages", "ANIMATION_ERR1", szText);
- GetProfString( szMessages, "Messages", "ANIMATION_ERR2", szText1);
- szText = szText + szText2 + "\n\n" + szText1;
- GetProfString( szMessages, "Messages", "ANIMATION_ERR3", szText1);
- MessageBox ( szText + "\n\n" + szText1,INFORMATION );
-
- nInstallOptions = nInstallOptions | ANIMATION_ABORTED;
-
- // goto ExitInstall;
- return;
-
- //--------------------------------------------------------------------
- // This procedure gets a path for Learner Management.
- //--------------------------------------------------------------------
- VerifyLMPath:
-
- // Check Learner Mamagement path
-
- StrSub(szWork, szLMPath,1,1);
- if (szWork != ":") then
-
- // Invalid path entered, reprompt.
-
- GetProfString( szMessages, "Messages", "INVALID_PATH", szText);
- MessageBox (szText, WARNING);
- bDone = FALSE;
- GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if ( szLMPath ="") then
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- return;
- endif;
- StrLength(szLMPath);
- nOffset = LAST_RESULT - 1;
- if (nOffset > -1) then
- StrSub(szWork, szLMPath, nOffset, 1);
- if (StrCompare( szWork, "\\" ) = 0) then // Trim the last backslash off
- StrSub(szLMPath, szLMPath, 0, nOffset);
- endif;
- endif;
-
- if (ExistsDisk( szDisk ) != EXISTS) then
- GetProfString( szMessages, "Messages", "INVALID_LM_PATH", szText);
- MessageBox( szText, WARNING );
- bDone = FALSE;
- GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if ( szLMPath ="") then
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- return;
- endif;
-
- if (StrCompare( szLMPath, "C:") = 0) then
-
- GetProfString( szMessages, "Messages", "LMPATH_C1", szText );
- GetProfString( szMessages, "Messages", "LMPATH_C2", szText1 );
- MessageBox ( szText + szLMPath + szText1, WARNING );
- bDone = FALSE;
- GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if ( szLMPath ="") then
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- return;
- endif;
-
- if (ExistsDir ( szLMPath ) != EXISTS) then
- if ( CreateDir ( szLMPath ) != 0 ) then
- GetProfString( szMessages, "Messages", "LMGT_DIR_ERR", szText);
- MessageBox( szText, WARNING );
- bDone = FALSE;
- GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if ( szLMPath ="") then
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- return;
- endif;
- endif;
-
- //------------------------------------------------------------------------------------------------
- // Loads/updates Learner Management file only when Learner Management is ON and the file either -
- // doesn't exist in the designated directory or on older copy of the file exists. -
- //------------------------------------------------------------------------------------------------
-
- if ( nInstallOptions & SB_LMGT_SELECT) then
- if (nMediaType & SINGLE_LEARNER) then
- if ( szVersion > "4.0" ) then
- bDone = TRUE;
- return;
- endif;
- endif;
- GetDisk( szSourcedir, szDisk );
- SRCDIR = szDisk ^ "\\";
- TARGETDIR = szLMPath;
- if(FileCompare( "NE_USERS.FMT",
- "NE_USERS.FMT",
- COMPARE_DATE ) != LESS_THAN) then
- if(FileCompare( "NE_USERS.FMT",
- "NE_USERS.FMT",
- COMPARE_DATE ) != EQUALS) then
- if (CopyFile( "NE_USERS.FMT", "NE_USERS.FMT" ) < 0) then
- GetProfString( szMessages, "Messages", "LMPATH_C1", szText );
- GetProfString( szMessages, "Messages", "LMPATH_C2", szText1 );
- MessageBox ( szText + szLMPath + szText1, WARNING );
- bDone = FALSE;
- GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if ( szLMPath ="") then
- szLMPath = szResultPath ^ "SKILLB";
- endif;
- return;
- endif;
- endif;
- endif;
- endif;
- bDone = TRUE;
- return;
-
- //-----------------------------------------------------------------------------------------------------
- // This procedure is called when the course to install is already installed on the hard drive. -
- //-----------------------------------------------------------------------------------------------------
- CoursePresent:
-
- GetProfString( szMessages, "Titles", "REINSTALL_VER", szText );
- SetDialogTitle ( DLG_ASK_YESNO, szText );
- GetProfString( szMessages, "Messages", "PRESENT_1", szText);
- szText = szText + szCourse;
- GetProfString( szMessages, "Messages", "PRESENT_2", szText1);
- szText = szText + szText1 + "\n";
- GetProfString( szMessages, "Messages", "PRESENT_3", szText1);
- szText = szText + szText1;
- if (AskYesNo( szText, YES ) = NO) then
- goto ExitInstall;
- endif;
- return;
-
- LoadDisk:
-
-
- FileSetBeginDefine ( "SBFileSet" );
-
- Enable ( STATUS );
- Enable ( FEEDBACK_FULL );
- if( CompressGet( "COURSE.Z", "", INCLUDE_SUBDIR ) <0) then
- szText = "COURSE.Z";
- call CopyError;
- endif;
-
- // Line added due to an Install Shield bug which required two compressed files - compress errorr intentionally not tracked.
- CompressGet( "GRAPHICS.Z", "", INCLUDE_SUBDIR );
-
- FileSetEndDefine ( "SBFileSet" );
-
- // Decompressing/Copying files to target directory
- // Show the % Complete Status Bar
-
- Enable ( STATUS );
- Enable ( FEEDBACK_FULL );
-
- GetProfString( szMessages, "Titles", "INS_CRS_FILES", szText );
- SetStatusWindow(9, szText );
- StatusUpdate( 9, 96 );
-
- // Initialize variables
-
- nDisk = 1;
- bDone = FALSE;
-
- // Perform FileSet
-
- while ( !bDone )
- nResult = FileSetPerform ( "SBFileSet", nDisk);
- switch ( nResult )
- case FS_TONEXTDISK:
- szTagFile = "COURSE.";
- NumToStr(szExt, nDisk );
- szTagFile = szTagFile + szExt;
- GetProfString( szMessages, "Messages", "INSERT_DISK", szText1);
- szText = szText1 + szExt;
- MessageBeep (0);
- EnterDisk (szText, szTagFile );
- if LAST_RESULT = CANCEL then
- call ConfirmCancel;
- EnterDisk (szText, szTagFile );
- if LAST_RESULT = CANCEL then
- call ExitInstall;
- endif;
- endif;
- case FS_DONE:
- // Files transferred successfully
- bDone = TRUE;
- case FS_OPERROR:
- GetProfString( szMessages, "Messages", "DECOMPRESS_ERR", szText1);
- MessageBox( szText1 + szTagFile, SEVERE );
- bDone = TRUE;
- case FS_INCORRECTDISK:
- GetProfString( szMessages, "Messages", "INCORRECT_DISK", szText);
- MessageBox( szText, INFORMATION );
- bDone = TRUE;
- case FS_OUTOFSPACE:
- MessageBox( SPACE_TITLE, SEVERE );
- bDone = TRUE;
- default:
- GetProfString( szMessages, "Messages", "DECOMPRESS_ERR", szText1);
- MessageBox( szText1 + szTagFile, SEVERE );
- bDone = TRUE;
- endswitch;
- endwhile;
-
- return;
-
- //--------------------------------------------------------------------
- // This procedure installs decompresses and copies -
- // files from the source CD drive. -
- //--------------------------------------------------------------------
-
- LoadCD:
-
- // ----------------------------------------------------------------------
- // If single-user version (network=no), checks WIN.INI file for NETG
- // sounds and adds sounds with default settings if they do not exist.
- // If sounds exist, does nothing.
- // ----------------------------------------------------------------------
-
- if ( nMediaType & CD_ROM ) then
- if ( szVersion > "4.0" ) then // Course is running off of CD - a new reference with "4" added
-
- GetProfString( szWinINI, "Sounds", "NETG4Rewind", szText );
- if ( szText = "" ) then
- WriteProfString (szWinINI, "Sounds", "NETG4Rewind", TARGETDIR^"NE_back.wav,NETG Rewind" );
- WriteProfString (szWinINI, "Sounds", "NETG4Forward", TARGETDIR^"NE_click.wav,NETG Page Forward" );
- WriteProfString (szWinINI, "Sounds", "NETG4FForward", TARGETDIR^"NE_next.wav,NETG Fast Forward" );
- WriteProfString (szWinINI, "Sounds", "NETG4Map", TARGETDIR^"NE_map.wav,NETG Course Map" );
- WriteProfString (szWinINI, "Sounds", "NETG4Exit", TARGETDIR^"NE_exit.wav,NETG Exit" );
- endif;
- //*******************************************************************************************************
- //
- // Special message added for 70011 - Windows 95 Product
- //
- //*******************************************************************************************************
- Disable( EXIT ); // Exit Button
- DefineDialog ( "SLUGGISH", 0, szDialogs, SLUGGISH, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED );
- bDone = FALSE;
- while (bDone = FALSE)
-
- nCmdValue = WaitOnDialog ("SLUGGISH");
- switch ( nCmdValue )
-
- case DLG_INIT:
- Delay(15);
- bDone = TRUE;
- endswitch;
- endwhile;
- EndDialog ("SLUGGISH");
- ReleaseDialog ("SLUGGISH");
-
-
-
- return; // Return and do not attempt to load files to the hard drive.
-
- else // Course loaded to the hard drive with WAV files installed to SKILLB
-
- GetProfString( szWinINI, "Sounds", "NETGRewind", szText );
- if ( szText = "" ) then
- WriteProfString (szWinINI, "Sounds", "NETGRewind", TARGETDIR^"NE_back.wav,NETG Rewind" );
- WriteProfString (szWinINI, "Sounds", "NETGForward", TARGETDIR^"NE_click.wav,NETG Page Forward" );
- WriteProfString (szWinINI, "Sounds", "NETGFForward", TARGETDIR^"NE_next.wav,NETG Fast Forward" );
- WriteProfString (szWinINI, "Sounds", "NETGMap", TARGETDIR^"NE_map.wav,NETG Course Map" );
- WriteProfString (szWinINI, "Sounds", "NETGExit", TARGETDIR^"NE_exit.wav,NETG Exit" );
- endif;
-
- endif;
- Enable ( STATUS );
- Enable ( FEEDBACK_FULL );
- if( CompressGet( "MISC.Z", "", COMP_UPDATE_DATE_NEWER ) <0) then // Install/Update sounds and/or Movie
- szText = "MISC.Z";
- call CopyError;
- endif;
- endif;
- Enable ( STATUS );
- Enable ( FEEDBACK_FULL );
-
- GetProfString( szMessages, "Titles", "INS_CRS_FILES", szText );
- SetStatusWindow(9, szText );
- StatusUpdate( 9, 97 );
-
- if( CompressGet( "COURSE.Z", "", INCLUDE_SUBDIR ) <0) then
- szText = "COURSE.Z";
- call CopyError;
- endif;
-
- // Line added due to an Install Shield bug which required two compressed files - compress error intentionally not tracked.
-
- CompressGet( "GRAPHICS.Z", "", INCLUDE_SUBDIR );
-
- return;
-
- //--------------------------------------------------------------------
- // Updates course specific information in the NETG.INI file
- //--------------------------------------------------------------------
- UpdateNETGINI:
-
- if ( nPresent = 1 ) then
- WriteProfString( szNETGINI, szCourse, "", "" );
- endif;
-
- if ( szVersion > "4.0" ) then
- if ( nInstallOptions & MASTERY_FULL_SELECT ) then
- WriteProfString( szNETGINI, szCourse, "Feedback", "2" );
- elseif ( nInstallOptions & MASTERY_PARTIAL_SELECT ) then
- WriteProfString( szNETGINI, szCourse, "Feedback", "1" );
- else
- WriteProfString( szNETGINI, szCourse, "Feedback", "0" );
- endif;
- endif;
-
- if ( nMediaType & CD_ROM ) then
- WriteProfString( szNETGINI, szCourse, "CDRom", "1" );
- WriteProfString( szNETGINI, szCourse, "EnableFlag", "6" );
- else
- WriteProfString( szNETGINI, szCourse, "CDRom", "0" );
- WriteProfString( szNETGINI, szCourse, "EnableFlag", "2" );
- endif;
-
- if ( szVersion > "3.0" ) then
- if ( nInstallOptions & TIME_OUT ) then
- WriteProfString( szNETGINI, "NETGctlintf", "TimeOut", "50" );
- else
- WriteProfString( szNETGINI, "NETGctlintf", "TimeOut", "0" );
- endif;
- endif;
-
- if ( szVersion > "3.1c" ) then
- WriteProfString( szNETGINI, szCourse, "AutoPageForward", szAutoPage );
- endif;
-
- if ( nInstallOptions & SB_LMGT_SELECT ) then
- WriteProfString( szNETGINI, szCourse, "UserPath", szLMPath );
- if (szVersion > "4.0") then
- if (nMediaType & SINGLE_LEARNER) then
- WriteProfString( szNETGINI, szCourse, "StudentMgt", "3" );
- else
- WriteProfString( szNETGINI, szCourse, "StudentMgt", "1" );
- endif;
- else
- WriteProfString( szNETGINI, szCourse, "StudentMgt", "1" );
- endif;
- endif;
-
- if ( nInstallOptions & SV_MANAGER_SELECT ) then
- WriteProfString( szNETGINI, szCourse, "StudentMgt", "2" );
- endif;
-
- if ( nInstallOptions & NO_MGT_SELECT ) then
- WriteProfString( szNETGINI, szCourse, "StudentMgt", "0" );
- endif;
-
- // Sets a language flag to Microsoft's 3 character code which is
- // set in the file
-
- WriteProfString( szNETGINI, szCourse, "Lang", szLang );
-
- WriteProfString( szNETGINI, szCourse, "Version", szVersion );
-
- if nPresent = 0
- then
- GetProfString( szNETGINI, "Course", "Total", szText );
- StrToNum( nTotalCourse, szText );
- GetProfString( szNETGINI, szCourse, "Path", szText );
- if (StrLength( szText ) = 0) then // Course not in list - add it to course# list in NETG.INI
- WriteProfString( szNETGINI, "Course", "Total", "" );
- nTotalCourse = nTotalCourse + 1;
- NumToStr( szTotal, nTotalCourse );
- WriteProfString( szNETGINI, "Course", "Total", szTotal );
- szText = "Name";
- szText = szText + szTotal;
- WriteProfString( szNETGINI, "Course", szText, szCourse );
- endif;
- endif;
- GetProfString( szNETGINI, "NETGctlintf", "nedebug", szText );
- StrLength( szText );
- if LAST_RESULT != 0
- then
- WriteProfString( szNETGINI, "NETGctlintf", "nedebug", "" );
- endif;
- WriteProfString( szNETGINI, szCourse, "Path", szResultPath );
- return;
-
- //--------------------------------------------------------------------
- // This procedure creates the NETG Skill Builder -
- // program group and icon for windows. -
- //--------------------------------------------------------------------
- Complete:
-
- GetProfString( szMessages, "Titles", "INIT_PG_ICON", szText );
- SetStatusWindow( 98, szText );
-
- // Write out path and command line to run course from icon
-
- szCommand = szCoursePath;
- szCommand = szCommand ^ "PRESENT";
- szWork = szCommand; // Define working directory.
- szCommand = szCommand ^ "PRESENT";
- szExec = szCommand + ".EXE "; // Added .EXE for PROPERTY.TXT "EXEC=" line
- szCommand = szCommand + " ";
- szPath = "..\\ICONWARE" ^ szCourse;
- szPath = szPath + ".IW";
- szCommand = szCommand + szPath;
- szExec = szExec + szPath;
-
- // Write out path to course icon file.
-
- szPath = szCoursePath ^ "PRESENT";
- szPath = szPath ^ szIconFile;
-
- //------------------------------------------------------------------------
- // Create batch file for VSI Menu install (Must be at least v1.45) -
- //------------------------------------------------------------------------
-
- szIVIPath = "WIN ";
- szIVIPath = szIVIPath + szCommand;
- szFile = szCourse;
- szFile = szFile + ".BAT";
- GetDisk( szNETGINI, szText );
- szText = szText + "\\";
-
- //---------------------------------------------------------------------------
- // Added functionality to not create an icon or batch file when
- // SkillVantage Manager is selected or for the SkillVantage Manager tutorial
- //---------------------------------------------------------------------------
-
- if !(( nInstallOptions & SV_MANAGER_SELECT ) | ( szVersion = "3.2x" )) then
- CreateFile( nHan, szText, szFile );
- WriteLine( nHan, szIVIPath );
- // szPgrp = "NETG SB Courseware";
- if ( AddProgItemEx( szPgrp, szIconTag, szCommand, szWork, szPath, 0, "", REPLACE ) < 0 )
- then
- GetProfString( szMessages, "Messages", "CREATE_ICON_ERR", szText);
- MessageBox( szText, WARNING );
- endif;
- endif;
-
-
- // ----------------------------------------------------------------------
- // Copies the course WS.INI file to course sub directory and updates
- // the lines with install specific data for multiuser courses and
- // modifies course VAR file so the movie doesn't play.
- // ----------------------------------------------------------------------
-
- UpdateWsIni:
-
- if ( nMediaType & LAN ) then
- szFile = szResultPath ^ "SKILLB\\WS\\WS.INI";
- WriteProfString( szFile, szCourse, "icon", szIconTag );
- WriteProfString( szFile, szCourse, "iconfile", szIconFile );
- WriteProfString( szFile, szCourse, "version", szVersion );
- WriteProfString( szFile, szCourse, "Lang", szLang );
- if ( nInstallOptions & SV_MANAGER_SELECT ) then
- WriteProfString( szFile, szCourse, "StudentMgt", "2" );
- elseif ( nMediaType & NO_SKILLB_LMGT ) then
- WriteProfString( szFile, szCourse, "StudentMgt", "no" );
- else
- WriteProfString( szFile, szCourse, "StudentMgt", "0" );
- endif;
- if ( szVersion > "4.0" ) then
- if ( nInstallOptions & MASTERY_FULL_SELECT ) then
- WriteProfString( szFile, szCourse, "Feedback", "2" );
- elseif ( nInstallOptions & MASTERY_PARTIAL_SELECT ) then
- WriteProfString( szFile, szCourse, "Feedback", "1" );
- else
- WriteProfString( szFile, szCourse, "Feedback", "0" );
- endif;
- endif;
- endif;
-
- // ----------------------------------------------------------------------
- // Creates a file called "PROPERTY.TXT" which resides in the course
- // directory that contains information to help students create CDF files.
- // ----------------------------------------------------------------------
-
- OpenFileMode ( FILE_MODE_APPEND );
- CreateFile ( nFile, szCoursePath, "PROPERTY.TXT" );
- OpenFile ( nFile, szCoursePath, "PROPERTY.TXT" );
- WriteLine ( nFile, "Course Runtime Information");
- WriteLine ( nFile, "");
- WriteLine ( nFile, "");
- WriteLine ( nFile, "Course Startup Command:");
- WriteLine ( nFile, szExec );
- WriteLine ( nFile, "");
- WriteLine ( nFile, "Working Directory:");
- WriteLine ( nFile, szWork);
- WriteLine ( nFile, "");
- WriteLine ( nFile, "");
- WriteLine ( nFile, "");
- CloseFile ( nFile );
-
- // --------------------------------------------------------------------------------
- // Updates OPENING.VAR file for PC/CBT & CD courses with registration information
- // --------------------------------------------------------------------------------
-
- if ((nMediaType & CD_ROM) | (nMediaType & PC_CBT)) then
-
- OpenFile ( nFile, szCoursePath ^ "VAR_" + szLang, "OPENING.VAR" );
- WriteLine ( nFile, "@copy5");
- GetProfString( szMessages, "Messages", "LICENCE_MESSAGE", szText);
- WriteLine ( nFile, szText);
- WriteLine ( nFile, "@copy6");
- WriteLine ( nFile, szName);
- WriteLine ( nFile, "@copy7");
- WriteLine ( nFile, szCompany );
- CloseFile ( nFile );
-
- endif;
-
- // --------------------------------------------------------------------------------
- // Updates COURSE.VAR file for PC/CBT & CD courses when the animation driver is
- // not installed and a problem occurs when attempting to add this driver
- // Need to add code to automatically get first letter for international installs
- // --------------------------------------------------------------------------------
-
- if ((nInstallOptions & ANIMATION_ABORTED ) | ( nMediaType & LAN )) then // turn the movie off.
-
- OpenFile ( nFile, szCoursePath ^ "VAR_" + szLang, "A" + szCourse + ".VAR" ); //***** needs to be internationalized
- WriteLine ( nFile, "@nomovie");
- WriteLine ( nFile, "1");
- CloseFile ( nFile );
-
- endif;
- return;
-
- //--------------------------------------------------------------------
- // This procedure is called when SkillVantage is selected for the -
- // current installation - NETG.INI is queried to check if verify -
- // StudentMgt is set to 2 for all courses at version 3.1 or later -
- // - for LAN installations, WS.INI is checked as well to ensure -
- // StudentMgt is set to 2 - If StudentMgt is set to 0, a prompt -
- // displays asking the user if s/he wants to set all courses to -
- // run with SkillVantage Manager. -
- //--------------------------------------------------------------------
- CheckSkillVantage:
-
- GetProfString( szMessages, "Titles", "INIT_PG_ICON", szText );
- SetStatusWindow( 98, szText );
-
- // Create lists for updating files for SkillVantage Manager
-
- listID1 = ListCreate( STRINGLIST );
- listID2 = ListCreate( STRINGLIST );
- wsDirList = ListCreate( STRINGLIST );
-
- // For LAN installations, create a list directories for current install
- // and definition to point to WS.INI file
-
- if ( nMediaType & LAN ) then
- FindAllDirs ( szResultPath ^ "SKILLB", EXCLUDE_SUBDIR, wsDirList );
- szFile = szResultPath ^ "\\SKILLB\\WS\\WS.INI";
- endif;
-
- // Create a list of icon names in the Skill Builder program group
-
- GetItemNameList ( szPgrp, listID1 );
- GetProfString(szNETGINI, "Course", "Total", szTotal );
- StrToNum( nTotalCourse, szTotal );
- szUpdateSkillV = "0";
- for nCount = 1 to nTotalCourse
- NameNum = "Name";
- NumToStr( szCount, nCount ); // Build NAMEn Keyname
- NameNum = NameNum + szCount;
- GetProfString( szNETGINI, "Course", NameNum, szCourse );
- if ( GetProfString(szNETGINI, szCourse, "StudentMgt", szStMgt ) < 0 ) then
- szStMgt = "";
- endif;
- GetProfString(szNETGINI, szCourse, "Path", szPath );
- if (((szStMgt = "0") | (szStMgt = "1")) & (szUpdateSkillV = "0" )) then
- GetProfString( szMessages, "Titles", "UPDATE_SV_DLG", szText);
- SetDialogTitle( DLG_ASK_YESNO, szText );
- GetProfString( szMessages, "Messages", "UPDATE_TO_SV", szText);
- szText = szText + "\n\n";
- GetProfString( szMessages, "Messages", "UPDATE_TO_SV1", szText1);
- szText = szText + szText1 + "\n\n";
- GetProfString( szMessages, "Messages", "UPDATE_TO_SV2", szText1);
- if (AskYesNo (szText + szText1, YES ) = YES) then
- szUpdateSkillV = "2";
- else
- szUpdateSkillV = "1";
- endif;
- endif;
- if (((szStMgt = "0") | (szStMgt = "1")) & ( szUpdateSkillV = "2" )) then
- WriteProfString( szNETGINI, szCourse, "StudentMgt", "2" );
- szStMgt = "2";
- endif;
- if (szStMgt = "2") then
- call DeleteIcon;
- if (FindFile ( szPath^"SKILLB\\WS", "WS.INI", szText ) = 0 ) then
- WriteProfString( szPath^"SKILLB\\WS\\WS.INI", szCourse, "StudentMgt", "2" );
- endif;
- endif;
- endfor;
- if (ListGetFirstString( listID2, szItemName ) != END_OF_LIST) then
- ShowGroup ( szPgrp, SW_SHOWMINNOACTIVE );
- ShowGroup ( szPgrp, SW_NORMAL );
- DeleteProgItem ( szPgrp, szItemName, "");
- lResult = 0;
- while (lResult != END_OF_LIST )
- lResult = ListGetNextString( listID2, szItemName );
- ShowGroup ( szPgrp, SW_SHOWMINNOACTIVE );
- ShowGroup ( szPgrp, SW_NORMAL );
- DeleteProgItem ( szPgrp, szItemName, "");
- endwhile;
- endif;
-
- // If user requested not to update courses to SkillVantage, doesn't check WS.INI file
-
- if ( szUpdateSkillV = "1" ) then
- return;
- endif;
-
- // Check WS.INI files for current course installation subdirectory
-
- if ( nMediaType & LAN ) then
- ListGetFirstString( wsDirList, szCoursePath );
- call SkillVantageWSINI;
- lResult = 0;
- while (lResult != END_OF_LIST )
- lResult = ListGetNextString( wsDirList, szCoursePath );
- call SkillVantageWSINI;
- endwhile;
- endif;
- return;
-
- // ----------------------------------------------------------------------
- // Subroutine that checks for icons to delete from the NETG SB Courseware directory
- // ----------------------------------------------------------------------
-
- DeleteIcon:
-
- // Build Command Lines for course to delete icon
-
- StrToUpper ( szPath, szPath );
- szCoursePath = szPath ^ "SKILLB\\";
- szCoursePath = szCoursePath + szCourse;
- szCommand = szCoursePath ^ "PRESENT\\PRESENT ";
- szCommand = szCommand + szCoursePath;
- szCommand = szCommand ^ "ICONWARE";
- szCommand = szCommand ^ szCourse;
- szCommand = szCommand + ".IW";
-
- szCommand2 = szCoursePath ^ "PRESENT\\PRESENT ";
- szCommand2 = szCommand2 + "..\\ICONWARE";
- szCommand2 = szCommand2 ^ szCourse;
- szCommand2 = szCommand2 + ".IW";
-
- szCommand3 = szCoursePath ^ "PRESENT\\PRESENT.EXE ";
- szCommand3 = szCommand3 + "..\\ICONWARE";
- szCommand3 = szCommand3 ^ szCourse;
- szCommand3 = szCommand3 + ".IW";
-
- szCommand4 = szCoursePath ^ "PRESENT\\PRESENT.EXE ";
- szCommand4 = szCommand4 + szCoursePath;
- szCommand4 = szCommand4 ^ "ICONWARE";
- szCommand4 = szCommand4 ^ szCourse;
- szCommand4 = szCommand4 + ".IW";
-
- // Check the command line built above against the icons in NETG SB Courseware - if the match, add an icon name to list to delete
-
- lResult = 0;
- if (ListGetFirstString( listID1, szItemName ) != END_OF_LIST) then
- QueryProgItem( szPgrp, szItemName, svCmdLine, svWrkDir, svIconPath, nvIconIndex, svShortCutKey, nvMinimizeFlag );
- StrToUpper ( svCmdLine, svCmdLine );
- if (( szCommand = svCmdLine )|( szCommand2 = svCmdLine ))|(( szCommand3 = svCmdLine )|( szCommand4 = svCmdLine )) then
- ListAddString( listID2, szItemName, AFTER );
- endif;
- while (lResult != END_OF_LIST )
- lResult = ListGetNextString( listID1, szItemName );
- QueryProgItem( szPgrp, szItemName, svCmdLine, svWrkDir, svIconPath, nvIconIndex, svShortCutKey, nvMinimizeFlag );
- StrToUpper ( svCmdLine, svCmdLine );
- if ((((szCommand=svCmdLine)|(szCommand2=svCmdLine))|((szCommand3=svCmdLine)|(szCommand4=svCmdLine)))&lResult!=END_OF_LIST) then
- ListAddString( listID2, szItemName, AFTER );
- endif;
- endwhile;
- endif;
- return;
-
- // Updates WS.INI file for based on CoursePath values
-
- SkillVantageWSINI:
-
- StrLength (szCoursePath);
- nOffset = LAST_RESULT - 6;
- StrSub( szCourse, szCoursePath, nOffset, 5 );
- GetProfString( szFile, szCourse, "StudentMgt", szStMgt );
- if (((szStMgt = "0") | (szStMgt = "1")) & (szUpdateSkillV = "0" )) then
- GetProfString( szMessages, "Titles", "UPDATE_SV_DLG", szText );
- SetDialogTitle( DLG_ASK_YESNO, szText );
- GetProfString( szMessages, "Messages", "UPDATE_TO_SV", szText);
- szText = szText + "\n\n";
- GetProfString( szMessages, "Messages", "UPDATE_TO_SV1", szText1);
- szText = szText + szText1 + "\n\n";
- GetProfString( szMessages, "Messages", "UPDATE_TO_SV2", szText1);
- if (AskYesNo (szText + szText1, YES ) = YES) then
- szUpdateSkillV = "2";
- endif;
- endif;
- if (((szStMgt = "0") | (szStMgt = "1")) & (szUpdateSkillV = "2")) then
- WriteProfString( szFile, szCourse, "StudentMgt", "2" );
- endif;
- return;
-
-
- //--------------------------------------------------------------------
- // This procedure will display an error when Install -
- // is unable to decompress or copy a file. -
- //--------------------------------------------------------------------
- CopyError:
-
- GetProfString( szMessages, "Messages", "DECOMPRESS_ERR", szText1);
- MessageBox( szText1 + szText, SEVERE );
- return;
-
-
-
- //-----------------------------------------------------------------------------
- // VARIABLES:
- // szResultPath - default or previously entered path to install the course
- // szText - Text to append to the default path
- // szCourse - Course number used to generate default path
- // PURPOSE
- // This subroutine displays a dialog box which allows the user to
- // change default path for installing either course files or Skill
- // Builder Learner Management files.
- //
- //-----------------------------------------------------------------------------
- ChangeDir:
-
-
- DefineDialog ("CHANGE_DIRECTORY", 0, szDialogs, CHANGE_DIRECTORY, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED );
- bDone2 = FALSE;
- while (bDone2 = FALSE )
- nCmdValue2 = WaitOnDialog ("CHANGE_DIRECTORY");
- switch ( nCmdValue2 )
- case DLG_INIT:
- nOffset = StrLength(szChangeDir);
- StrSub(szText, szChangeDir, nOffset - 1, 1);
- if (StrCompare(szText, "\\") != 0 ) then
- szChangeDir = szChangeDir + "\\";
- endif;
- StrSub( szDisk, szChangeDir, 0, 2);
- StrSub( szText, szChangeDir, 0, 1);
- CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
- call CreateDirList;
- CtrlDir("CHANGE_DIRECTORY", ID_DRIVES, szChangeDir + "*.*", DLG_DIR_DRIVE);
-
- StrSub( szText, szChangeDir, 0, 1);
- CtrlSetCurSel("CHANGE_DIRECTORY", ID_DRIVES, "[-"+ szText +"-]");
- CtrlSelectText( "CHANGE_DIRECTORY", ID_CHANGE_PATH );
-
- case IDOK:
- CtrlGetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szNewPath);
- nOffset = StrLength(szNewPath);
- StrSub( szText, szNewPath, nOffset - 13, 13);
- if (StrCompare(szText, "SKILLB\\" + szCourse + "\\") = 0) then
- StrSub( szNewPath, szNewPath, 0, nOffset - 13);
- endif;
- StrToUpper(szNewPath, szNewPath);
- szText = "OK";
- bDone2 = TRUE;
- call VerifyTarget;
-
- case IDCANCEL:
- szText = "NO";
- bDone2 = TRUE;
-
- case IDHELP:
- szText = "Change Directory";
- call Help_Handler;
-
- case DLG_CLOSE:
- szText = "NO";
- bDone2 = TRUE;
-
- case ID_DIRECTORIES:
- nCmdValue2 = CtrlGetSubCommand("CHANGE_DIRECTORY");
- switch ( nCmdValue2 )
- case LISTBOX_SELECT:
-
- case LISTBOX_ENTER:
- CtrlGetCurSel("CHANGE_DIRECTORY", ID_DIRECTORIES, szNewPath);
- StrToUpper(szNewPath, szNewPath);
- nOffset = StrLength(szNewPath);
- StrSub(szNewPath, szNewPath, 1, nOffset - 2 );
- if (StrCompare( szNewPath, ".." ) = 0) then
- nOffset = StrLength(szChangeDir);
- nCount = 1;
- szText = "";
- while (szText != "\\")
- nCount++;
- StrSub(szText, szChangeDir, nOffset - nCount, 1);
- endwhile;
- StrSub( szChangeDir, szChangeDir, 0, (nOffset - nCount) + 1);
- else
- szChangeDir = szChangeDir ^ szNewPath + "\\";
- endif;
- CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
- call CreateDirList;
- endswitch;
-
- case ID_DRIVES:
- nCmdValue2 = CtrlGetSubCommand("CHANGE_DIRECTORY");
- switch ( nCmdValue2 )
- case COMBOBOX_SELECT:
- CtrlGetCurSel("CHANGE_DIRECTORY", ID_DRIVES, szDisk);
- StrSub(szDisk, szDisk, 2, 1);
- StrToUpper(szDisk, szDisk);
- szChangeDir = szDisk + ":\\";
- CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
- call CreateDirList;
- case EDITBOX_CHANGE:
- CtrlGetText("CHANGE_DIRECTORY", ID_DRIVES, szText);
- szDisk = "[-" + szText + "-]";
- StrToUpper(szDisk, szDisk);
- szChangeDir = szDisk + ":\\";
- CtrlSetCurSel("CHANGE_DIRECTORY", ID_DRIVES, szText);
- CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
- call CreateDirList;
- CtrlGetCurSel("CHANGE_DIRECTORY", ID_DRIVES, szDisk);
- endswitch;
- endswitch;
- endwhile;
- EndDialog ("CHANGE_DIRECTORY");
- ReleaseDialog ("CHANGE_DIRECTORY");
- return;
-
- CreateDirList:
-
-
- nResult = 0;
- nResult = ListGetFirstString(ChangeDirList, svWrkDir);
- while (nResult != END_OF_LIST)
- ListDeleteString (ChangeDirList);
- nResult = ListGetFirstString(ChangeDirList, svWrkDir);
- endwhile;
-
-
- nOffset=StrLength(szChangeDir);
- FindAllDirs (szChangeDir, EXCLUDE_SUBDIR, ChangeDirList);
- nResult = ListGetFirstString(ChangeDirList, svWrkDir);
- if (nResult = 1) then
- ListAddString ( ChangeDirList, "[..]", BEFORE );
- CtrlSetList ( "CHANGE_DIRECTORY", ID_DIRECTORIES, ChangeDirList );
- return;
- endif;
- nOffset=StrLength(svWrkDir);
- nCount = nOffset - 1;
- szText="";
- while (StrCompare(szText,"\\") != 0)
- nCount--;
- StrSub(szText,svWrkDir,nCount,1);
- endwhile;
- nCount = nCount + 1;
- nResult = 0;
- while (nResult != END_OF_LIST)
- nOffset=StrLength(svWrkDir);
- nOffset=nOffset - 1;
- StrSub(svWrkDir, svWrkDir, nCount, nOffset - nCount );
- svWrkDir = "[" + svWrkDir + "]";
- nResult = ListSetCurrentString (ChangeDirList, svWrkDir);
- nResult = ListGetNextString(ChangeDirList, svWrkDir);
- endwhile;
- if ( nCount > 3 ) then
- ListAddString ( ChangeDirList, "[..]", BEFORE );
- endif;
- CtrlSetList ( "CHANGE_DIRECTORY", ID_DIRECTORIES, ChangeDirList );
- return;
-
- Exit_Handler:
-
- GetProfString( szMessages, "Messages", "EXIT_ASK_MESG", szText);
- if (AskYesNo (szText, YES) = YES) then
- goto ExitInstall;
- endif;
- return;
-
- Help_Handler:
-
- nHwdInstall = GetWindowHandle(HWND_INSTALL);
- // if (StrCompare(szText,"Change Directory") = 0) then
- // WinHelp( nHwdInstall, SRCDIR ^ "instlhlp.hlp", HELP_CONTEXT, 11 );
- // else
- WinHelp( nHwdInstall, szSourcedir ^ "instlhlp.hlp", HELP_CONTENTS, 0 );
- // endif;
- hWnd = FindWindow( "MS_WINHELP", "");
- ShowWindow ( hWnd, SW_SHOW );
- return;
-
- //--------------------------------------------------------------------
- // This procedure sets the error message -
- // Invalid INSTALL.INI file on hard drive -
- //--------------------------------------------------------------------
- BadInstallINI:
-
- GetProfString( szMessages, "Messages", "BAD_INSTALL_INI", szText);
- MessageBox ( szText, SEVERE );
- goto ExitInstall;
-
- //--------------------------------------------------------------------
- // This procedure will confirm with the users if they -
- // want to terminate the installation of the course. -
- //--------------------------------------------------------------------
- ConfirmCancel:
-
- GetProfString( szMessages, "Messages", "EXIT_ASK_MESG", szText);
- if (AskYesNo (szText, YES) = YES) then
- goto ExitInstall;
- endif;
- return;
-
- //--------------------------------------------------------------------
- // Installing Learner Management file for diskette install.
- //--------------------------------------------------------------------
-
-
- //--------------------------------------------------------------------
- // This procedure will Put an exit message -
- // to the screen and exit install program -
- //--------------------------------------------------------------------
-
- ExitMessage:
-
- GetProfString( szMessages, "Messages", "EXIT_MESSAGE", szText);
- MessageBox( szText, INFORMATION );
- goto ExitInstall;
- //
-
- //---------------------------------------------------------------------
- // Exit Install Program -
- //---------------------------------------------------------------------
-
- ExitInstall:
-
- // Clean up lists from memory
-
- VarRestore( SRCTARGETDIR );
- ListDestroy( listID1 );
- ListDestroy( listID2 );
- ListDestroy( wsDirList );
- ListDestroy(AgreementList);
- ListDestroy(ChangeDirList);
- UnUseDLL ("NEINSTL.DLL");
- WinHelp( nHwdInstall, szSourcedir ^ "instlhlp.hlp", HELP_QUIT, 0 );
- WinHelp( nHwdInstall, szSourcedir ^ "lic.hlp", HELP_QUIT, 0 );
-
- exit;
-
- //-------------------- End of Install Program -------------------------
-
- // Windows API Interface functions script file.
- #include ".\\winsub.rul"
-
-
-
- // ----------------------------------------------------------------------
- // Copyright ⌐ 1995, National Education Training Group, Inc. -
- // All rights reserved. -
- //-----------------------------------------------------------------------
-